package com.charlotte.study.gupao.iterator.general;

/**
 * @author junjie.ding
 * @date 2020/3/16
 */
public class Test {

    public static void main(String[] args) {

        IAggregate<String> aggregate = new ConcreteAggregate<>();

        aggregate.add("one");
        aggregate.add("two");
        aggregate.add("three");

        Iterator<String> iterator = aggregate.iterator();
        while(iterator.hasNext()){
            System.out.println(iterator.next());
        }

    }
}
